﻿// Copyright 2007-2009 Stuart Caborn, Alex Scordellis
//  
//  Licensed under the Apache License, Version 2.0 (the "License"); 
//  http://www.apache.org/licenses/LICENSE-2.0

namespace SampleApp.MonitoredGenerics
{
    public interface IRepository<T>
    {
        T Load(int id);
        void Save(T entity);
        int Count();
    }

    public class GenericConcreteRepository<T> : IRepository<T>
    {
        public T Load(int id)
        {
            return default(T);
        }

        public void Save(T entity)
        {
        }

        public int Count()
        {
            return 666;
        }

        public void Overloaded(T entity)
        {
        }

        public void Overloaded(bool something)
        {
        }
    }

    public interface InterfaceWithGenericMethods
    {
        void Foo<T>(T arg);
    }

    public class ImplementsInterfaceWithGenericMethods : InterfaceWithGenericMethods
    {
        #region InterfaceWithGenericMethods Members

        public void Foo<T>(T arg)
        {
        }

        #endregion
    }

    public class Customer
    {
    }

    public class CustomerRepository : IRepository<Customer>
    {
        public Customer Load(int id)
        {
            return null;
        }

        public void Save(Customer entity)
        {
        }

        public int Count()
        {
            return 5678;
        }
    }

    public class Widget
    {
    }

    public class WidgetRepository : IRepository<Widget>
    {
        public Widget Load(int id)
        {
            return null;
        }

        public void Save(Widget entity)
        {
        }

        public int Count()
        {
            return 5678;
        }
    }
}